package com.ruoyi.web.controller.shop.member;

import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.shop.member.domain.ShopMember;
import com.ruoyi.shop.member.service.IShopMemberService;

/**
 * 会员用户controller
 * 
 * |----------------------------------------------------------------------|
 * |favorshop [简单好用，让您喜爱的小商城]
 * |----------------------------------------------------------------------|
 * |copyright www.favorshop.cn All rights reserved.
 * |----------------------------------------------------------------------|
 * | @author xuxiang
 * |----------------------------------------------------------------------|
 * | @date 2023-05-29
 * |----------------------------------------------------------------------|
 */
@Controller
@RequestMapping("/shop/member")
public class ShopMemberController extends BaseController {

	@Autowired
	private IShopMemberService memberService;

	private String prefix = "shop/member/user";

	@GetMapping()
	public String index() {
		return prefix + "/user";
	}

	/**
	 * 查询会员用户
	 */
	@RequiresPermissions("shop:member:list")
	@PostMapping("/list")
	@ResponseBody
	public TableDataInfo list(ShopMember shopMember) {
		startPage();
		List<ShopMember> list = memberService.selectMemberList(shopMember);
		return getDataTable(list);
	}

}
